//-------Aliases-------//
private alias 0x50000 : max.speed

// Function declarations
reserve function GolfHud_DebugDraw
reserve function GolfHud_DebugSpawn

// Static Values



event ObjectDraw
	temp4 = 0
	
	if object[0].state == Golf_Ready
		temp4 = 1
	end if
	if object[0].state == Golf_Power
		temp4 = 2
	end if
	if object[0].state == Golf_Hitting
		temp4 = 2
	end if
	
	if temp4 > 0
		cos256(temp0, golf.angle)
		sin256(temp1, golf.angle)
		temp0 <<= 14
		temp1 <<= 14
		temp0 += object[0].xpos
		temp1 += object[0].ypos
		temp1 += 0xA 0000
		DrawSpriteXY(0, temp0, temp1)
	end if
	if temp4 > 1
		temp1 = golf.bar
		temp1 >>= 2
		temp1++
		EditFrame(1, -28, -22, temp1, 22, 12, 210)
		temp0 = object[0].ypos
		temp0 -= 0x30 0000
		DrawSpriteXY(1, object[0].xpos, temp0)
		DrawSpriteXY(2, object[0].xpos, temp0)
	end if
end event

event ObjectStartup
	if options.gameMode == 5
		LoadSpriteSheet("Players/Golf.gif")	
		//Golf
		SpriteFrame(-9, -9, 17, 17, 1, 1) //0 Target
		SpriteFrame(-28, -22, 64, 22, 12, 210) //1 Power bar
		SpriteFrame(-39, -22, 77, 22, 1, 233) //2 Power bar empty
		
		object[20].type = TypeName[Golf HUD]
		object[20].priority = PRIORITY_ACTIVE
		object[20].drawOrder = 5
	end if
	start.xpos = 0
	start.ypos = 0
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Players/Sonic1.gif")
	SpriteFrame(-16, -19, 28, 39, 1, 1)
end event